/*
 * File:   ProjectorType.h
 * Author: longtran
 *
 * Class that contains the list of all the projectors in the system, the list is a singleton.
 * 
 * Created on March 17, 2011, 1:22 PM
 */

#ifndef PROJECTORDATA_H
#define PROJECTORDATA_H

#include "projector.h"
#include "projectortype.h"

#include <QtCore/QMutex>


namespace Projector
{

class ProjectorData
{
    static ProjectorData*           sInstance;

    static QMutex*                  sMutex;
    QMap<QString, Projector*>*      mProjectors;
    QMap<QString, ProjectorType*>*  mProjectorTypes;

    ProjectorData();
    virtual ~ProjectorData();

public:

    // returns the static instance of projector data, creates it if it doesnt exist
    static ProjectorData* GetInstance();

    void AddProjector( Projector* projector );
    void AddProjectorType( ProjectorType* projectorType );

    Projector const* GetProjector( int index ) const;
    Projector const* GetProjector( QString& projName ) const;
    QMap<QString, Projector*> const* GetProjectors() const;

};
}
#endif // PROJECTORDATA_H
